package org.mathig.poker.table;

import java.util.ArrayList;
import java.util.List;

import org.mathig.poker.Card;
import org.mathig.poker.PokerHand;
import org.mathig.poker.hand.Hand;

public class PlayerCards {

	private List<Card> cards = new ArrayList<Card>();

	private Hand pokerHand;

	@Override
	public String toString() {
		return "" + pokerHand;
	}

	public void compute(List<Card> board) {
		List<Card> sevenCards = new ArrayList<Card>();
		sevenCards.addAll(cards);
		sevenCards.addAll(board);
		pokerHand = PokerHand.searchBestHand(sevenCards);
	}

	public void add(Card card) {
		cards.add(card);
	}

	public void throwCards() {
		cards.clear();
	}

	public List<Card> getCards() {
		return cards;
	}

	public void setCards(List<Card> cards) {
		this.cards = cards;
	}

	public Hand getPokerHand() {
		return pokerHand;
	}

}
